#ifndef _GAME_PLAYER_H_
#define _GAME_PLAYER_H_

#include "Box2D/Box2D.h"
#include "cocos2d.h"
#include "GameEntity.h"
#include "Prop.h"

USING_NS_CC;

class PlayerEventListener
{
  public:
    virtual void onPlayerDead() = 0;
    virtual void setPropCount(int count) = 0;
};

class Player : public GameEntity
{
  public:
    typedef enum
    {
      JUMP,
      RUN,
      WALK,
      ROUND,
      NORMAL_SPEED,
      DEAD,
    } PlayerAction;
  public:
    virtual ~Player();
    static Player * create(b2World * world);
    bool init();
    void action(PlayerAction action);
    virtual EntityType getEntityType();
    void getProp(PropType propType);
    void setPlayerEventListener(PlayerEventListener * pPlayerEventListener);
    void restart();
    virtual void createBody();
    void setCanJump();
    void setLevel(int level);
    float getSpeed();
  private:
    Player(b2World * world);
    PlayerAction state;
    PlayerEventListener * pPlayerEventListener;
    int propCount;
    bool canJump;
    int level;
    float speed;
};

#endif
